home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / catD / psema.z / psema
Encoding:
Text File  |  1998-10-30  |  3.2 KB  |  67 lines

  1.  
  2.  
  3.  
  4. ppppsssseeeemmmmaaaa((((DDDD3333XXXX))))                                                          ppppsssseeeemmmmaaaa((((DDDD3333XXXX))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _pppp_ssss_eeee_mmmm_aaaa - perform a "P" or wait semaphore operation
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _""""_ssss_yyyy_ssss_////_tttt_yyyy_pppp_eeee_ssss_...._hhhh_""""
  13.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _""""_ssss_yyyy_ssss_////_pppp_aaaa_rrrr_aaaa_mmmm_...._hhhh_""""
  14.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _""""_ssss_yyyy_ssss_////_ssss_eeee_mmmm_aaaa_...._hhhh_""""
  15.  
  16.      _pppp_ssss_eeee_mmmm_aaaa_((((_ssss_eeee_mmmm_aaaa______tttt _****_s_e_m_a_p_,,,, _iiii_nnnn_tttt _f_l_a_g_s_))))_;;;;
  17.  
  18. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  19.      _pppp_ssss_eeee_mmmm_aaaa performs a "P" semaphore operation on the given semaphore.  The
  20.      value associated with the semaphore is decremented by 1.  If the
  21.      semaphore value then becomes less than 0, the process goes to sleep and
  22.      gives up the CPU.
  23.  
  24.      Use _s_e_m_a_p to pass _pppp_ssss_eeee_mmmm_aaaa a pointer to the semaphore you want to decrement.
  25.      Use _f_l_a_g_s to specify whether you want the process to be able to be woken
  26.      by a signal if it ends up going to sleep.  A flag value of (_f_l_a_g_s &
  27.      _PPPP_MMMM_AAAA_SSSS_KKKK) > _PPPP_ZZZZ_EEEE_RRRR_OOOO will make the process interruptible, otherwise it is not.
  28.      The required symbolic constants are defined in _pppp_aaaa_rrrr_aaaa_mmmm_...._hhhh.  If the process
  29.      is awakened by a signal, then the semaphore value is incremented and is
  30.      allowed to continue.
  31.  
  32.      To initialize and allocate a semaphore, call _iiii_nnnn_iiii_tttt_nnnn_ssss_eeee_mmmm_aaaa or _iiii_nnnn_iiii_tttt_nnnn_ssss_eeee_mmmm_aaaa.
  33.  
  34.    RRRReeeettttuuuurrrrnnnn VVVVaaaalllluuuueeeessss
  35.      _pppp_ssss_eeee_mmmm_aaaa returns -1 if a breakable sleep is interrupted by a signal.
  36.      Otherwise _pppp_ssss_eeee_mmmm_aaaa returns 0.
  37.  
  38.    NNNNooootttteeee
  39.      _pppp_ssss_eeee_mmmm_aaaa may cause the calling process to sleep; it must not be called from
  40.      within an interrupt procedure.
  41.  
  42. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  43.      _ssss_llll_eeee_eeee_pppp(D3), _SSSS_LLLL_EEEE_EEEE_PPPP______LLLL_OOOO_CCCC_KKKK(D3)
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.